﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:con="clr-namespace:Q2Q.UI.Converters">


	<con:SolidColorBrushToAccentConverter x:Key="SCBC" />

	<Style x:Key="CustomButton1" TargetType="Button">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Button">
					<Border
						Background="{TemplateBinding Background}"
						BorderBrush="{TemplateBinding BorderBrush}"
						BorderThickness="{TemplateBinding BorderThickness}"
						HorizontalAlignment="Stretch"
						VerticalAlignment="Stretch"
						Width="{TemplateBinding Width}"
						Height="{TemplateBinding Height}"
						FocusVisualStyle="{x:Null}"
						UseLayoutRounding="True">
						<ContentPresenter
							HorizontalAlignment="Center"
							VerticalAlignment="Center"
							UseLayoutRounding="True"
							Margin="{TemplateBinding Padding}"
							/>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="Background" Value="{DynamicResource ControlBackgroundColorBrush}" />
		<Setter Property="Foreground" Value="{DynamicResource ForegroundAccentColorBrush}" />
		<Setter Property="BorderBrush" Value="{DynamicResource Color9Brush}" />
		<Style.Triggers>
			<Trigger Property="IsMouseOver" Value="True">
				<Setter Property="Background" Value="{DynamicResource HoverColorBrush}" />
				<Setter Property="Foreground" Value="{DynamicResource ForegroundColorBrush}" />
			</Trigger>
			<Trigger Property="IsPressed" Value="True">
				<Setter Property="Background" Value="{DynamicResource HighlightColorBrush}" />
			</Trigger>
			<Trigger Property="IsFocused" Value="True">
				<Setter Property="BorderBrush" Value="#FF959595" />
			</Trigger>
		</Style.Triggers>
	</Style>

	<Style TargetType="{x:Type Button}" BasedOn="{StaticResource CustomButton1}" />
	
	<Style x:Key="CustomButton2" TargetType="{x:Type Button}" BasedOn="{StaticResource CustomButton1}">
		<Setter Property="Background" Value="{DynamicResource ControlBackgroundColorBrush}" />
		<Setter Property="Foreground" Value="{DynamicResource ForegroundAccentColorBrush}" />
		<Setter Property="BorderBrush" Value="{DynamicResource Color9Brush}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Button">
					<Border x:Name="Bord"
						Background="{TemplateBinding Background}"
						BorderBrush="{TemplateBinding BorderBrush}"
						BorderThickness="{TemplateBinding BorderThickness}"
						HorizontalAlignment="Stretch"
						VerticalAlignment="Center"
						Width="{TemplateBinding Width}"
						Height="{TemplateBinding Height}"
						
						FocusVisualStyle="{x:Null}"
						UseLayoutRounding="True">
						<ContentPresenter IsHitTestVisible="False"
							HorizontalAlignment="Center"
							VerticalAlignment="Center"
							UseLayoutRounding="True"
							Margin="{TemplateBinding Padding}"
							/>
					</Border>

					<ControlTemplate.Triggers>
						<Trigger Property="IsFocused" Value="True">
							<Setter Property="BorderBrush" Value="{DynamicResource SystemButtonForegroundBrush}" />
						</Trigger>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter Property="BorderBrush" Value="{DynamicResource WindowBorderBrush}" />
							<Setter Property="Background" TargetName="Bord" Value="{Binding Path=Background, ElementName=Bord, Mode=OneTime, Converter={StaticResource SCBC}, ConverterParameter=-10}" />
						</Trigger>
						<Trigger Property="IsPressed" Value="True">
							<Setter Property="BorderBrush" Value="{DynamicResource WindowBorderBrush}" />
							<Setter Property="Background" TargetName="Bord" Value="{Binding Path=Background, ElementName=Bord, Mode=OneTime, Converter={StaticResource SCBC}, ConverterParameter=30}" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style x:Key="RepeatButton" TargetType="RepeatButton">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="RepeatButton">
					<Border
						Background="{TemplateBinding Background}"
						BorderBrush="{TemplateBinding BorderBrush}"
						BorderThickness="{TemplateBinding BorderThickness}"
						HorizontalAlignment="Stretch"
						VerticalAlignment="Stretch"
						Width="{TemplateBinding Width}"
						Height="{TemplateBinding Height}"
						FocusVisualStyle="{x:Null}"
						UseLayoutRounding="True">
						<ContentPresenter
							HorizontalAlignment="Center"
							VerticalAlignment="Center"
							UseLayoutRounding="True"
							Margin="{TemplateBinding Padding}"
							/>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="Background" Value="{DynamicResource ControlBackgroundColorBrush}" />
		<Setter Property="Foreground" Value="{DynamicResource TextForeground}" />
		<Setter Property="BorderBrush" Value="{DynamicResource Color9Brush}" />
		<Style.Triggers>
			<Trigger Property="IsMouseOver" Value="True">
				<Setter Property="Background" Value="{DynamicResource HoverColorBrush}" />
				<Setter Property="Foreground" Value="{DynamicResource TextForeground}" />
			</Trigger>
			<Trigger Property="IsPressed" Value="True">
				<Setter Property="Background" Value="{DynamicResource HighlightColorBrush}" />
			</Trigger>
			<Trigger Property="IsFocused" Value="True">
				<Setter Property="BorderBrush" Value="#FF959595" />
			</Trigger>
			<Trigger Property="IsEnabled" Value="False">
				<Setter Property="Foreground" Value="{DynamicResource InactiveButtonForeground}" />
			</Trigger>
		</Style.Triggers>
	</Style>

	<Style x:Key="CustomRadioButton1" TargetType="RadioButton">
		<Setter Property="Background" Value="{DynamicResource ControlBackgroundColorBrush}" />
		<Setter Property="Foreground" Value="{DynamicResource ForegroundAccentColorBrush}" />
		<Setter Property="BorderBrush" Value="{DynamicResource Color9Brush}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="RadioButton">
						<Border x:Name="Bord"
						Background="{TemplateBinding Background}"
						BorderBrush="{TemplateBinding BorderBrush}"
						BorderThickness="{TemplateBinding BorderThickness}"
						HorizontalAlignment="Stretch"
						VerticalAlignment="Center"
						
						
						FocusVisualStyle="{x:Null}"
						UseLayoutRounding="True">
							<ContentPresenter IsHitTestVisible="False"
							HorizontalAlignment="Center"
							VerticalAlignment="Center"
							UseLayoutRounding="True"
							Margin="{TemplateBinding Padding}"
							Width="{TemplateBinding Width}"
							Height="{TemplateBinding Height}"
							/>
						</Border>
					
					<ControlTemplate.Triggers>
						<Trigger Property="IsFocused" Value="True">
							<Setter Property="BorderBrush" Value="{DynamicResource SystemButtonForegroundBrush}" />
						</Trigger>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter Property="BorderBrush" Value="{DynamicResource WindowBorderBrush}" />
							<Setter Property="Background" TargetName="Bord" Value="{Binding Path=Background, ElementName=Bord, Mode=OneTime, Converter={StaticResource SCBC}, ConverterParameter=1.5}" />
						</Trigger>
						<Trigger Property="IsChecked" Value="True">
							<Setter Property="CornerRadius" Value="13" TargetName="Bord" />
							<Setter Property="BorderBrush" Value="{DynamicResource WindowBorderBrush}" />
							<Setter Property="Background" TargetName="Bord" Value="{Binding Path=Background, ElementName=Bord, Mode=OneTime, Converter={StaticResource SCBC}, ConverterParameter=1.5}" />
							<Setter Property="Margin" Value="0,4,0,0" TargetName="Bord" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

</ResourceDictionary>
